using System;
using Microsoft.SPOT;

namespace G2Tech.SharedContext
{
    /// <summary>
    /// This is the Interface that must be implemented by any comunication channel.
    /// </summary>
    public interface ICommunicationChannel
    {
        /// <summary>
        /// Gets or Sets the channel name
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Get the Channel Local Address
        /// </summary>
        DeviceAddress LocalAddress { get; }

        /// <summary>
        /// Get the Channel EndPoint Address
        /// </summary>
        DeviceAddress EndPointAddress { get; }

        /// <summary>
        /// Link Cost
        /// </summary>
        LinkCost Cost { get; }

        /// <summary>
        /// Link Cost
        /// </summary>
        LinkStatus Status { get; set; }   

        /// <summary>
        /// Send an update to the channel
        /// </summary>
        /// <param name="item"></param>
        void SendItem(ContextItem item);

        /// <summary>
        /// On Item Received event
        /// </summary>
        event CommunicationChannelDelegates.CommunicationChannelItemReceivedEventHandler OnItemReceived;
    }
}
